<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户登录</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
    <style>
        body {
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
            margin: 0;
            background-color: #f4f4f4;
        }

        .login-container {
            width: 400px;
            background-color: white;
            padding: 30px;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }

        .login-container h2 {
            text-align: center;
            margin-bottom: 30px;
        }

        .form-floating {
            margin-bottom: 20px;
        }

        .btn-primary {
            width: 100%;
        }
    </style>
</head>
<body>
<div class="login-container">
    <h2>用户登录</h2>
<!--  param.error  当访问地址参数有error的时候就提示-->
    <div th:if="${param.error}" class="text-danger text-center mt-3">
        用户名或密码错误，请重新输入。
    </div>
    <form th:action="@{/login}" method="post">
        <div class="form-floating">
            <input type="text" class="form-control" id="username" name="username" placeholder="请输入用户名">
            <label for="username">用户名</label>
        </div>
        <div class="form-floating">
            <input type="password" class="form-control" id="password" name="password" placeholder="请输入密码">
            <label for="password">密码</label>
        </div>
        <button type="submit" class="btn btn-primary">登录</button>
    </form>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>